#include "Grid.h"
Grid::Grid( QWidget *parent)
    :  QPushButton(parent)
{
	QObject::connect(this,SIGNAL(clicked()),this,SLOT(onClicked()));
}
void Grid::setWidget(ai* aiClass){
	this->mainClass = aiClass;
}
/**
 * change the text on the button
 */
void Grid::render(){
	if(value == -1){
		setText(QString::fromUtf8("X"));
	}
	if(value ==1){
		setText(QString::fromUtf8("O"));
	}
	if(value == 0){
		setText(QString::fromUtf8(" "));
	}
}
void Grid::setValue(int i){
	if(i<=1 && i>=-1)
	{
		value = i;
		render();
	}
}
